﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using CSharp4ExpressionMetaCompiler;
using SStuff.MetaEffects.Model;

namespace Sample2_CompositeShader.Providers
{
    public class InvertColorProvider : IColorModifierProvider
    {
        #region IColorModifierProvider Members

        public Expression<Action<ColorOnlyParameter>> GetShaderExpression()
        {
            return o =>
                Block.Declare(new ColorOnlyParameter(), vars =>
                Block.Default
                .Assign(vars.Color, new float4(1.0f - vars.Color.xyz, vars.Color.w)));
            ;
        }

        #endregion
    }
}
